<?php
class map
{
	private $urlp = "https://apis.map.qq.com/ws/distance/v1/";//用于1对多 测试距离
	private $key = "Y72BZ-S453X-ZZL4Y-ZQK7N-XRGG2-RDBAU";
	public $to = '';

  public function __construct()
  {
  }


	public function cejuli($from,$to)
	{

		$key = $this->key;
		$url = $this->urlp;
		return file_get_contents($url."?from=".$from."&to=".$to."&key=".$key);
	}

  public function getLocation($location)
	{

		$key = $this->key;
		return file_get_contents("https://apis.map.qq.com/ws/geocoder/v1/?"."location=".$location."&key=".$key."&get_poi=1");
	}

	public function search($from,$keyword)
	{

		$key = $this->key;
		return file_get_contents("https://apis.map.qq.com/ws/place/v1/search?"."boundary=region(".$from.",0)"."&keyword=".$keyword."&page_size=20&page_index=1&orderby=_distance&key=".$key);
	}

}
